#!/bin/bash

OS=`uname -s`
if [ x"$OS" == x"Darwin" ]; then
    basedir=/Users/v/Documents
else
    basedir=/opt/data
fi

curdir=`pwd`

docker run -it --name nginx-web \
	-v $basedir/todocker/fileserver:/opt/data/proj/apps/fileserver \
	-v $basedir/todocker/logs/nginx:/var/log/nginx \
	-v $curdir/dist:/opt/data/proj/apps/snaky-client \
	-v $curdir/nginx.conf:/etc/nginx/nginx.conf \
	-v $curdir/snaky-new.conf:/etc/nginx/conf.d/default.conf \
	-v $curdir/snaky-autotest.conf:/etc/nginx/conf.d/snaky-autotest.conf \
	-v $curdir/snaky-fileserver.conf:/etc/nginx/conf.d/snaky-fileserver.conf \
	-v /etc/letsencrypt:/etc/letsencrypt \
	-v /etc/localtime:/etc/localtime \
	-p 7888:80 \
	-p 5555:5555 \
	-p 8090:8090 \
	-p 4443:443 \
	--restart always \
	nginx:latest $1

